//
//  ReleaseStep6ViewController.m
//  Gunz
//
//  Created by Joggy on 16/4/16.
//  Copyright © 2016年 NUPT. All rights reserved.
//

#import "ReleaseStep6ViewController.h"
#import "GZConst.h"
#import "BarButtonView.h"
#import "QYNotice.h"

@interface ReleaseStep6ViewController ()

@end

@implementation ReleaseStep6ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    [self prepareForNav];
    [self prepareForLayout];
    [QYNotice showSuccess:@"恭喜您！任务发布成功！" toView:self.view];
}

- (void)prepareForNav {
    [super prepareForNav];
    self.title = @"发布任务";
    //导航左按键
    UIImage *image = [UIImage imageNamed:@"all_back"];
    UIButton *leftBarButton = [UIButton buttonWithType:UIButtonTypeSystem];
    leftBarButton.frame = CGRectMake(0, 0, image.size.width, image.size.height);
    leftBarButton.layer.position = CGPointMake(22, 22);
    [leftBarButton setImage:[image imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal] forState:UIControlStateNormal];
    [leftBarButton addTarget:self action:@selector(back) forControlEvents:UIControlEventTouchUpInside];
    self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc] initWithCustomView:leftBarButton];
}

- (void)prepareForLayout {
    [super prepareForLayout];
    //底部按钮
    BarButtonView *barButton = [[BarButtonView alloc] initWithFrame:CGRectMake(0, [GZConst getScreenHeight] - 64 - BBViewHeight, [GZConst getScreenWidth], BBViewHeight) name:@"返回首页"];
    [barButton.but addTarget:self action:@selector(back) forControlEvents:UIControlEventTouchUpInside];
    [self.view addSubview:barButton];
    UIImageView *waitingImageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 23.75, 38)];
    waitingImageView.layer.position = CGPointMake(screenWidth/2, screenHeight*0.3);
    waitingImageView.image = [UIImage imageNamed:@"icon_waiting"];
    [self.view addSubview:waitingImageView];
    UILabel *waitingLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 190, 16)];
    waitingLabel.layer.position = CGPointMake(screenWidth/2, waitingImageView.layer.position.y + waitingImageView.frame.size.height);
    waitingLabel.textColor = TEXT_DETAIL_COLOR;
    waitingLabel.font = [UIFont systemFontOfSize:13];
    waitingLabel.text = @"任务已经提交，后台正在审核......";
    [self.view addSubview:waitingLabel];
}

- (void)back {
    [self dismissViewControllerAnimated:true completion:nil];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
